package com.efounder.frame.bean;

import android.text.TextUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by meijun on 17-7-10.
 */

public class FilterNodeBean {
    private List<FilterNodeBean> childNodes = new ArrayList<>();
    private String sql;
    private String name="未命名";


    private String bgColor;
    private String textColor;
    public FilterNodeBean(String name) {
        this.name = name;
    }

    public List<FilterNodeBean> getChildNodes() {
        return childNodes;
    }


    public void addChild(FilterNodeBean filterNodeBean){
        childNodes.add(filterNodeBean);
    }
    public void setChildNodes(List<FilterNodeBean> childNodes) {
        this.childNodes = childNodes;
    }

    public String getSql() {
        return sql;
    }

    public void setSql(String sql) {
        this.sql = sql;
    }

    @Override
    public String toString() {
        return name;
    }

    /**
     * 判断此节点下是否还有子孩子
     * 非常重要,如有自孩子,将弹出子框,
     * 如没有,则响应点击事件;
     * @return
     */
    public boolean isHaveChild(){
        return TextUtils.isEmpty(sql);
    }

    public String getName() {
        return name;
    }

    public String getTextColor() {
        return textColor;
    }

    public String getBgColor() {
        return bgColor;
    }

    public void setBgColor(String bgColor) {
        this.bgColor = bgColor;
    }

    public void setTextColor(String textColor) {
        this.textColor = textColor;
    }


}
